package cn.itcast.feign;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
//@EnableFeignClients(defaultConfiguration = FeignClientConfiguration.class)
@EnableFeignClients
//@FeignClient( name = "userservice" , configuration = FeignClientConfiguration.class)
public class FeignApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(FeignApiApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    // 设置负载均衡规则轮询
    //@Bean
    //public IRule nacosRule(){
    //    return new NacosRule();
    //}
}